package com.yunxin.core.infra.persistence.converter;

import com.yunxin.core.domain.model.user.*;
import com.yunxin.core.infra.persistence.entity.user.*;
import org.mapstruct.Mapper;

/**
 * @author zero°
 * @since 2023-07-12
 */
@Mapper(componentModel = "spring")
public interface UserInfoConverter {

    /**
     * do 转 entity
     *
     * @param userAuthDO userAuthDO
     * @return UserAuth
     */
    UserAuth toUserAuth(UserAuthDO userAuthDO);

    /**
     * do 转 entity
     *
     * @param userInfoDO userInfoDO
     * @return UserInfo
     */
    UserInfo toUserInfo(UserInfoDO userInfoDO);

    /**
     * entity 转 do
     *
     * @param entity entity
     * @return UserVisitorInfoDO
     */
    UserVisitorInfoDO formUserVisitorInfo(UserVisitorInfo entity);

    /**
     * entity 转 do
     *
     * @param entity entity
     * @return UserIpInfoDO
     */
    UserIpInfoDO formUserIpInfo(UserIpInfo entity);

    /**
     * entity 转 do
     *
     * @param entity entity
     * @return UserAuthDO
     */
    UserAuthDO formUserAuth(UserAuth entity);


    /**
     * entity 转 do
     *
     * @param entity entity
     * @return UserInfoDO
     */
    UserInfoDO formUserInfo(UserInfo entity);


    /**
     * entity 转 do
     *
     * @param entity entity
     * @return UserLoginRecordDO
     */
    UserLoginRecordDO formUserLoginRecord(UserLoginRecord entity);

}
